import time
 
start = time.clock()
first = 100
second = 100
max = 1000
results = []
 
for x in xrange(first, max):
  for y in xrange(second, max):
    prod = x * y
    if str(prod) == str(prod)[::-1]:
      results.append(prod)
           
results.sort()
end = time.clock()
t = end - start
print "Answer: " + str(results[-1]) + " in " + str(t) + " seconds"
